// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread 'PED5'

0AB3: 600 > 100 //set default ped health 

FOR 0@ = 0 TO 9 STEP 1
if 0@ == 0                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "PED_HEALTH" key "VALUE"                                                                                                                                                     
END           
if 0@ == 1                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Civmale" key "WEAPON_ID"                                                                                                                                                     
END                                                                                                                                                                                                                                                  
if 0@ == 2                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Civfemale" key "WEAPON_ID"                                                                                                                                                   
END                                                                                                                                                                                                                                                  
if 0@ == 3                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Dealer" key "WEAPON_ID"                                                                                                                                                      
END                                                                                                                                                                                                                                                  
if 0@ == 4                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Medic" key "WEAPON_ID"                                                                                                                                                       
END                                                                                                                                                                                                                                                  
if 0@ == 5                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Fireman" key "WEAPON_ID"                                                                                                                                                     
END                                                                                                                                                                                                                                                  
if 0@ == 6                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Criminal" key "WEAPON_ID"                                                                                                                                                    
END                                                                                                                                                                                                                                                  
if 0@ == 7                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Security" key "WEAPON_ID"                                                                                                                                                    
END                                                                                                                                                                                                                                                  
if 0@ == 8                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Prostitute" key "WEAPON_ID"                                                                                                                                                  
END                                                                                                                                                                                                                                                  
if 0@ == 9                                                                                                                                                                                                                                        
then 0AF0: write_int 1@ to_ini_file "CLEO\PED_HOOK.ini" section "Mission Dick" key "WEAPON_ID"                                                                                                                                                
END
2@ = 600 //START AT
005A: 2@ += 0@ //ADD 0@
0AB3: 2@ > 1@ //SEND PARAM AS WEAPON ID TO EXTERNAL SCRIPT
END

//const
//    PED_TYPE_ID    = 1@
//    PHANDLER       = 2@
//    WEAPON_ID      = 3@
//    CORD_X         = 4@
//    CORD_Y         = 5@
//    CORD_Z         = 6@
//    WEAPON_MODEL   = 7@
//    ITEMS          = 0@
//    count          = 8@
//    hval           = 9@
//    val            = 10@
//    cop_weapon     = 11@
//end


WHILE TRUE
    WAIT 0

for 8@ = 1 to 9 step 1
    Actor.StorePos($PLAYER_ACTOR, 4@, 5@, 6@)
    if 0AE1: 2@ = random_actor_near_point 4@ 5@ 6@ in_radius 80.0 find_next 1 pass_deads 0 //IF and SET                                                                  
    JF continue     
    if and                                                                        
        056D:   actor 2@ defined                                                 
        803B:   not  2@ == $PLAYER_ACTOR // (int)                                
    JF continue
    9@ = actor.Health(2@)                  
    if or                                                     
        9@ == 100                                            
        9@ <= 100                                            
    then                                                      
        if not 9@ <> 100                                     
        then                                                
            0AB4: 10@ < 600                                 
            005a: 9@ += 10@                               
            Actor.Health(2@) = 9@                        
        end                                                   
    end
    0AB4: 10@ < 599        
    if 10@ == true
    then Actor.SetWalkStyle(2@, "DRUNKMAN")
    end                            
    089F: get_actor 2@ pedtype_to 1@
    0@   = 600
    005A: 0@ += 8@                                                                                                     
    0AB4: 3@ < 0@
    IF and 
       3@ > 0
       45 > 3@
    JF continue
    IF AND  //FUCKING CRASHED ID
       not 3@ == 19
       not 3@ == 20
       not 3@ == 21
       not 3@ == 39
       not 3@ == 40
       not 3@ == 44
       not 3@ == 45
    JF continue        
    0781: get_weapon_with_ID 3@ model_to 7@
    if not model.Available(7@) 
    then 
        Model.Load(7@)
        038B: load_requested_models
    end
    if 056D:   actor 2@ defined
    jf continue
    if not actor.Dead(2@)
    jf continue                                  
    if AND
        1@ == 4
        8@ == 1
    then 
        if not Actor.HasWeapon(2@, 3@)                              
        then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
        end
        0470: 11@ = actor 2@ current_weapon                            
        if 11@ == 22                                                                
        then                                                                               
            if not 3@ == 22                                                                
            then                                                                           
                if not Actor.HasWeapon(2@, 3@)                                            
                then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                              
                end                                                                        
            end                                                                            
        end                                                                        
    else
        if AND
            1@ == 5
            8@ == 2
        then 
            if not Actor.HasWeapon(2@, 3@)                              
            then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
            end
            0470: 11@ = actor 2@ current_weapon                             
            if 11@ == 22                                                          
            then                                                                         
                if not 3@ == 22                                                   
                then                                                                     
                    if not Actor.HasWeapon(2@, 3@)                          
                    then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                    end                                                                  
                end                                                                      
            end                                                                          
        else
            if AND
                1@ == 17
                8@ == 3
            then 
                if not Actor.HasWeapon(2@, 3@)                              
                then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                end
                0470: 11@ = actor 2@ current_weapon                             
                if 11@ == 22                                                          
                then                                                                         
                    if not 3@ == 22                                                   
                    then                                                                     
                        if not Actor.HasWeapon(2@, 3@)                          
                        then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                        end                                                                  
                    end                                                                      
                end                                                                          
            else
                if AND 
                    1@ == 18
                    8@ == 4
                then 
                    if not Actor.HasWeapon(2@, 3@)                              
                    then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                    end
                    0470: 11@ = actor 2@ current_weapon                             
                    if 11@ == 22                                                         
                    then                                                                         
                        if not 3@ == 22                                                   
                        then                                                                     
                            if not Actor.HasWeapon(2@, 3@)                          
                            then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                            end                                                                  
                        end                                                                      
                    end                                                                          
                else
                    if AND
                        1@ == 19
                        8@ == 5
                    then 
                        if not Actor.HasWeapon(2@, 3@)                              
                        then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                        end
                        0470: 11@ = actor 2@ current_weapon                             
                        if 11@ == 22                                                          
                        then                                                                         
                            if not 3@ == 22                                                   
                            then                                                                     
                                if not Actor.HasWeapon(2@, 3@)                          
                                then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                                end                                                                  
                            end                                                                      
                        end                                                                          
                    else
                        if AND
                            1@ == 20
                            8@ == 6
                        then 
                            if not Actor.HasWeapon(2@, 3@)                              
                            then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                            end
                            0470: 11@ = actor 2@ current_weapon                             
                            if 11@ == 22                                                          
                            then                                                                         
                                if not 3@ == 22                                                   
                                then                                                                     
                                    if not Actor.HasWeapon(2@, 3@)                          
                                    then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                                    end                                                                  
                                end                                                                      
                            end                                                                          
                        else
                            if AND
                                1@ == 21
                                8@ == 7
                            then 
                                if not Actor.HasWeapon(2@, 3@)                              
                                then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                                end
                                0470: 11@ = actor 2@ current_weapon                             
                                if 11@ == 22                                                          
                                then                                                                         
                                    if not 3@ == 22                                                   
                                    then                                                                     
                                        if not Actor.HasWeapon(2@, 3@)                          
                                        then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                                        end                                                                  
                                    end                                                                      
                                end                                                                          
                            else
                                if AND
                                    1@ == 22
                                    8@ == 8
                                then 
                                    if not Actor.HasWeapon(2@, 3@)                              
                                    then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                                    end
                                    0470: 11@ = actor 2@ current_weapon                             
                                    if 11@ == 22                                                          
                                    then                                                                         
                                        if not 3@ == 22                                                   
                                        then                                                                     
                                            if not Actor.HasWeapon(2@, 3@)                          
                                            then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                                            end                                                                  
                                        end                                                                      
                                    end                                                                          
                                else
                                    if AND
                                        1@ == 23
                                        8@ == 9
                                    then 
                                        if not Actor.HasWeapon(2@, 3@)                              
                                        then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)                
                                        end
                                        0470: 11@ = actor 2@ current_weapon                             
                                        if 11@ == 22                                                          
                                        then                                                                         
                                            if not 3@ == 22                                                   
                                            then                                                                     
                                                if not Actor.HasWeapon(2@, 3@)                          
                                                then Actor.GiveWeaponAndAmmo(2@, 3@, 999999)            
                                                end                                                                  
                                            end                                                                      
                                        end                                                                          
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end
END